#include "PerformanceTimer.hpp"

PerformanceTimer::PerformanceTimer()
{
  if (!QueryPerformanceFrequency(&frequency))
    throw new exception("This computer does not have a performance timer.");
}

void PerformanceTimer::Start()
{
  QueryPerformanceCounter(&start);
}

void PerformanceTimer::Stop()
{
  QueryPerformanceCounter(&end);
}

double PerformanceTimer::GetSecondsDifference()
{
  return (end.QuadPart - start.QuadPart) / static_cast<double>(frequency.QuadPart);
}